package com.dynamixsoftware.printershare;

import android.app.Activity;
import android.app.AlertDialog.Builder;
import android.app.ProgressDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.Signature;
import android.content.res.Resources;
import android.os.Build;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
import android.preference.PreferenceManager;
import android.provider.Settings.Secure;
import android.telephony.TelephonyManager;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewConfiguration;
import android.view.Window;
import android.widget.PopupMenu;
import android.widget.PopupMenu.OnMenuItemClickListener;
import android.widget.TextView;
import com.dynamixsoftware.printershare.data.XmlUtil;
import com.flurry.android.FlurryAgent;
import com.google.android.googleapps.IGoogleLoginService;
import com.google.android.googleapps.IGoogleLoginService.Stub;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import org.w3c.dom.Element;

public abstract class ActivityRoot extends Activity {
	private static final String fpc_fn = ".psfpc";
	private static final String fpc_fp = App.ext_storage_root + "/tmp/";
	private static boolean fpc_inited;
	private static final boolean[] is_premium = { false };
	private static final boolean[] is_premium_bad = { false };
	protected Action action = new Action();
	private ProgressDialog checking_progress_dialog;
	private ProgressDialog current_progress_dialog;
	private boolean finishing;
	private boolean is_premium_checked;
	protected String last_error;
	protected SharedPreferences prefs;
	protected boolean skip_update;

	private void checkPremiumKey() {
		String str1 = getCampaignID();
		if (("blackberry".equals(str1)) || ("amazon".equals(str1))
				|| ("medion".equals(str1)) || ("cisco".equals(str1))) {
			is_premium[0] = true;
		}
		label278: for (;;) {
			return;
			if (is_premium_bad[0] == 0) {
			}
			for (int i = 1;; i = 0) {
				if ((this.is_premium_checked) || (i == 0)) {
					break label278;
				}
				String str2 = getPackageName();
				try {
					PackageInfo localPackageInfo4 = getPackageManager()
							.getPackageInfo(str2, 64);
					localPackageInfo1 = localPackageInfo4;
				} catch (PackageManager.NameNotFoundException localNameNotFoundException1) {
					for (;;) {
						boolean bool;
						Object localObject;
						PackageInfo localPackageInfo1 = null;
					}
				}
				bool = str2.endsWith(".printershare");
				localObject = null;
				if (!bool) {
				}
				try {
					String str5 = str2 + ".premium";
					PackageInfo localPackageInfo3 = getPackageManager()
							.getPackageInfo(str5, 64);
					localObject = localPackageInfo3;
				} catch (PackageManager.NameNotFoundException localNameNotFoundException3) {
					for (;;) {
						label204: localObject = null;
					}
				}
				if (localObject == null) {
				}
				try {
					int j = str2.lastIndexOf(".printershare");
					String str4 = str2.substring(0, j + 13) + ".premium";
					PackageInfo localPackageInfo2 = getPackageManager()
							.getPackageInfo(str4, 64);
					localObject = localPackageInfo2;
				} catch (PackageManager.NameNotFoundException localNameNotFoundException2) {
					String str3;
					Intent localIntent;
					break label204;
				}
				if ((localPackageInfo1 == null)
						|| (localObject == null)
						|| (!localPackageInfo1.signatures[0].toCharsString()
								.equals(localObject.signatures[0]
										.toCharsString()))) {
					break;
				}
				str3 = this.prefs.getString("campaign_premium", null);
				if ((str2.indexOf(".dev") <= 0) && (str3 == null)) {
					break label280;
				}
				is_premium[0] = true;
				return;
			}
		}
		label280: if (localObject.versionCode > 9) {
			this.checking_progress_dialog = new ProgressDialog(this);
			this.checking_progress_dialog.setIndeterminate(true);
			this.checking_progress_dialog.setCancelable(false);
			this.checking_progress_dialog.setMessage(getResources().getString(
					2131099746));
			this.checking_progress_dialog.show();
			localIntent = new Intent();
			localIntent.setClassName(localObject.packageName,
					"com.dynamixsoftware.printershare.premium.Validate");
			localIntent.putExtra("device_id", getDeviceID());
			startActivityForResult(localIntent, 539);
			return;
		}
		if ("pdassi".equals(getCampaignID())) {
			is_premium[0] = true;
			return;
		}
		is_premium[0] = false;
	}

	private void logVersion(final String paramString1,
			final String paramString2, final String paramString3) {
		new Thread() {
			public void run() {
				try {
					if (paramString3.startsWith(";")) {
					}
					for (String str1 = paramString3.substring(1);; str1 = paramString3) {
						String str2 = App.getRawCPUABI();
						String str3 = Build.MODEL;
						String str4 = Build.VERSION.RELEASE;
						String str5 = FlurryAgent.getPhoneId();
						HttpURLConnection localHttpURLConnection = (HttpURLConnection) new URL(
								"http://psl.dynamixsoftware.com/log.jsp")
								.openConnection();
						localHttpURLConnection.setConnectTimeout(5000);
						localHttpURLConnection.setReadTimeout(5000);
						localHttpURLConnection.setDoOutput(true);
						localHttpURLConnection.setRequestMethod("POST");
						localHttpURLConnection.setRequestProperty(
								"Content-Type", "application/octet-stream");
						localHttpURLConnection.getOutputStream().write(
								("psver=" + URLEncoder.encode(paramString1)
										+ "&deviceid="
										+ URLEncoder.encode(str5) + "&model="
										+ URLEncoder.encode(str3) + "&version="
										+ URLEncoder.encode(str4) + "&cpuabi="
										+ URLEncoder.encode(str2) + "&al="
										+ URLEncoder.encode(str1)
										+ "&certname=" + URLEncoder
										.encode(paramString2)).getBytes());
						localHttpURLConnection.getResponseCode();
						return;
					}
					return;
				} catch (Exception localException) {
					localException.printStackTrace();
					App.reportThrowable(localException);
				}
			}
		}.start();
	}

	/* Error */
	private void logVersion(final boolean[] paramArrayOfBoolean) {
		// Byte code:
		// 0: aload_1
		// 1: iconst_0
		// 2: baload
		// 3: ifeq +248 -> 251
		// 6: ldc 221
		// 8: astore_2
		// 9: aload_0
		// 10: invokevirtual 75
		// com/dynamixsoftware/printershare/ActivityRoot:getCampaignID
		// ()Ljava/lang/String;
		// 13: astore_3
		// 14: ldc 223
		// 16: aload_3
		// 17: invokevirtual 83 java/lang/String:equals (Ljava/lang/Object;)Z
		// 20: ifeq +238 -> 258
		// 23: ldc 225
		// 25: astore 4
		// 27: aload 4
		// 29: aload_0
		// 30: getfield 133 com/dynamixsoftware/printershare/ActivityRoot:prefs
		// Landroid/content/SharedPreferences;
		// 33: new 29 java/lang/StringBuilder
		// 36: dup
		// 37: invokespecial 32 java/lang/StringBuilder:<init> ()V
		// 40: ldc 227
		// 42: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 45: aload_2
		// 46: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 49: invokevirtual 47 java/lang/StringBuilder:toString
		// ()Ljava/lang/String;
		// 52: aconst_null
		// 53: invokeinterface 141 3 0
		// 58: invokevirtual 83 java/lang/String:equals (Ljava/lang/Object;)Z
		// 61: ifne +872 -> 933
		// 64: aload_0
		// 65: invokevirtual 94
		// com/dynamixsoftware/printershare/ActivityRoot:getPackageName
		// ()Ljava/lang/String;
		// 68: astore 5
		// 70: aload_0
		// 71: invokevirtual 98
		// com/dynamixsoftware/printershare/ActivityRoot:getPackageManager
		// ()Landroid/content/pm/PackageManager;
		// 74: aload 5
		// 76: bipush 64
		// 78: invokevirtual 104
		// android/content/pm/PackageManager:getPackageInfo
		// (Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
		// 81: astore 42
		// 83: aconst_null
		// 84: astore 14
		// 86: aload 42
		// 88: ifnull +84 -> 172
		// 91: aload 42
		// 93: getfield 126 android/content/pm/PackageInfo:signatures
		// [Landroid/content/pm/Signature;
		// 96: astore 43
		// 98: aconst_null
		// 99: astore 14
		// 101: aload 43
		// 103: ifnull +69 -> 172
		// 106: aload 42
		// 108: getfield 126 android/content/pm/PackageInfo:signatures
		// [Landroid/content/pm/Signature;
		// 111: arraylength
		// 112: istore 44
		// 114: aconst_null
		// 115: astore 14
		// 117: iload 44
		// 119: ifle +53 -> 172
		// 122: aload 42
		// 124: getfield 126 android/content/pm/PackageInfo:signatures
		// [Landroid/content/pm/Signature;
		// 127: iconst_0
		// 128: aaload
		// 129: invokevirtual 231 android/content/pm/Signature:toByteArray ()[B
		// 132: astore 45
		// 134: new 233 java/io/ByteArrayInputStream
		// 137: dup
		// 138: aload 45
		// 140: invokespecial 236 java/io/ByteArrayInputStream:<init> ([B)V
		// 143: astore 46
		// 145: ldc 238
		// 147: invokestatic 244
		// java/security/cert/CertificateFactory:getInstance
		// (Ljava/lang/String;)Ljava/security/cert/CertificateFactory;
		// 150: aload 46
		// 152: invokevirtual 248
		// java/security/cert/CertificateFactory:generateCertificate
		// (Ljava/io/InputStream;)Ljava/security/cert/Certificate;
		// 155: checkcast 250 java/security/cert/X509Certificate
		// 158: invokevirtual 254 java/security/cert/X509Certificate:getIssuerDN
		// ()Ljava/security/Principal;
		// 161: invokeinterface 259 1 0
		// 166: astore 47
		// 168: aload 47
		// 170: astore 14
		// 172: aload_0
		// 173: getfield 61 com/dynamixsoftware/printershare/ActivityRoot:action
		// Lcom/dynamixsoftware/printershare/ActivityRoot$Action;
		// 176: astore 48
		// 178: new 261 com/dynamixsoftware/printershare/ActivityRoot$3
		// 181: dup
		// 182: aload_0
		// 183: aload_1
		// 184: invokespecial 264
		// com/dynamixsoftware/printershare/ActivityRoot$3:<init>
		// (Lcom/dynamixsoftware/printershare/ActivityRoot;[Z)V
		// 187: astore 49
		// 189: aload 48
		// 191: aconst_null
		// 192: aload 49
		// 194: invokevirtual 268
		// com/dynamixsoftware/printershare/ActivityRoot$Action:run
		// (Ljava/lang/Runnable;Ljava/lang/Runnable;)V
		// 197: aload_1
		// 198: iconst_0
		// 199: baload
		// 200: ifeq +259 -> 459
		// 203: aload 14
		// 205: ifnull +254 -> 459
		// 208: aload 14
		// 210: invokevirtual 272 java/lang/String:length ()I
		// 213: bipush 77
		// 215: if_icmpeq +244 -> 459
		// 218: aload 5
		// 220: ldc 106
		// 222: invokevirtual 110 java/lang/String:endsWith
		// (Ljava/lang/String;)Z
		// 225: ifeq +234 -> 459
		// 228: aload_1
		// 229: iconst_0
		// 230: iconst_0
		// 231: bastore
		// 232: new 274 com/dynamixsoftware/printershare/ActivityRoot$4
		// 235: dup
		// 236: aload_0
		// 237: invokespecial 275
		// com/dynamixsoftware/printershare/ActivityRoot$4:<init>
		// (Lcom/dynamixsoftware/printershare/ActivityRoot;)V
		// 240: astore 50
		// 242: aload_0
		// 243: aload 50
		// 245: putfield 61 com/dynamixsoftware/printershare/ActivityRoot:action
		// Lcom/dynamixsoftware/printershare/ActivityRoot$Action;
		// 248: goto -248 -> 0
		// 251: ldc_w 277
		// 254: astore_2
		// 255: goto -246 -> 9
		// 258: aload_3
		// 259: astore 4
		// 261: goto -234 -> 27
		// 264: astore 10
		// 266: aload 10
		// 268: invokevirtual 280 java/lang/Exception:printStackTrace ()V
		// 271: aload 10
		// 273: invokestatic 284
		// com/dynamixsoftware/printershare/App:reportThrowable
		// (Ljava/lang/Throwable;)V
		// 276: aload_0
		// 277: getfield 61 com/dynamixsoftware/printershare/ActivityRoot:action
		// Lcom/dynamixsoftware/printershare/ActivityRoot$Action;
		// 280: astore 11
		// 282: new 261 com/dynamixsoftware/printershare/ActivityRoot$3
		// 285: dup
		// 286: aload_0
		// 287: aload_1
		// 288: invokespecial 264
		// com/dynamixsoftware/printershare/ActivityRoot$3:<init>
		// (Lcom/dynamixsoftware/printershare/ActivityRoot;[Z)V
		// 291: astore 12
		// 293: aload 11
		// 295: aconst_null
		// 296: aload 12
		// 298: invokevirtual 268
		// com/dynamixsoftware/printershare/ActivityRoot$Action:run
		// (Ljava/lang/Runnable;Ljava/lang/Runnable;)V
		// 301: aload_1
		// 302: iconst_0
		// 303: baload
		// 304: istore 13
		// 306: aconst_null
		// 307: astore 14
		// 309: iload 13
		// 311: ifeq +148 -> 459
		// 314: aconst_null
		// 315: astore 14
		// 317: iconst_0
		// 318: ifeq +141 -> 459
		// 321: aconst_null
		// 322: invokevirtual 272 java/lang/String:length ()I
		// 325: istore 39
		// 327: aconst_null
		// 328: astore 14
		// 330: iload 39
		// 332: bipush 77
		// 334: if_icmpeq +125 -> 459
		// 337: aload 5
		// 339: ldc 106
		// 341: invokevirtual 110 java/lang/String:endsWith
		// (Ljava/lang/String;)Z
		// 344: istore 40
		// 346: aconst_null
		// 347: astore 14
		// 349: iload 40
		// 351: ifeq +108 -> 459
		// 354: aload_1
		// 355: iconst_0
		// 356: iconst_0
		// 357: bastore
		// 358: new 274 com/dynamixsoftware/printershare/ActivityRoot$4
		// 361: dup
		// 362: aload_0
		// 363: invokespecial 275
		// com/dynamixsoftware/printershare/ActivityRoot$4:<init>
		// (Lcom/dynamixsoftware/printershare/ActivityRoot;)V
		// 366: astore 41
		// 368: aload_0
		// 369: aload 41
		// 371: putfield 61 com/dynamixsoftware/printershare/ActivityRoot:action
		// Lcom/dynamixsoftware/printershare/ActivityRoot$Action;
		// 374: goto -374 -> 0
		// 377: astore 6
		// 379: aload_0
		// 380: getfield 61 com/dynamixsoftware/printershare/ActivityRoot:action
		// Lcom/dynamixsoftware/printershare/ActivityRoot$Action;
		// 383: astore 7
		// 385: new 261 com/dynamixsoftware/printershare/ActivityRoot$3
		// 388: dup
		// 389: aload_0
		// 390: aload_1
		// 391: invokespecial 264
		// com/dynamixsoftware/printershare/ActivityRoot$3:<init>
		// (Lcom/dynamixsoftware/printershare/ActivityRoot;[Z)V
		// 394: astore 8
		// 396: aload 7
		// 398: aconst_null
		// 399: aload 8
		// 401: invokevirtual 268
		// com/dynamixsoftware/printershare/ActivityRoot$Action:run
		// (Ljava/lang/Runnable;Ljava/lang/Runnable;)V
		// 404: aload_1
		// 405: iconst_0
		// 406: baload
		// 407: ifeq +49 -> 456
		// 410: iconst_0
		// 411: ifeq +45 -> 456
		// 414: aconst_null
		// 415: invokevirtual 272 java/lang/String:length ()I
		// 418: bipush 77
		// 420: if_icmpeq +36 -> 456
		// 423: aload 5
		// 425: ldc 106
		// 427: invokevirtual 110 java/lang/String:endsWith
		// (Ljava/lang/String;)Z
		// 430: ifeq +26 -> 456
		// 433: aload_1
		// 434: iconst_0
		// 435: iconst_0
		// 436: bastore
		// 437: new 274 com/dynamixsoftware/printershare/ActivityRoot$4
		// 440: dup
		// 441: aload_0
		// 442: invokespecial 275
		// com/dynamixsoftware/printershare/ActivityRoot$4:<init>
		// (Lcom/dynamixsoftware/printershare/ActivityRoot;)V
		// 445: astore 9
		// 447: aload_0
		// 448: aload 9
		// 450: putfield 61 com/dynamixsoftware/printershare/ActivityRoot:action
		// Lcom/dynamixsoftware/printershare/ActivityRoot$Action;
		// 453: goto -453 -> 0
		// 456: aload 6
		// 458: athrow
		// 459: aload_0
		// 460: getfield 133 com/dynamixsoftware/printershare/ActivityRoot:prefs
		// Landroid/content/SharedPreferences;
		// 463: new 29 java/lang/StringBuilder
		// 466: dup
		// 467: invokespecial 32 java/lang/StringBuilder:<init> ()V
		// 470: ldc 227
		// 472: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 475: aload_2
		// 476: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 479: invokevirtual 47 java/lang/StringBuilder:toString
		// ()Ljava/lang/String;
		// 482: aconst_null
		// 483: invokeinterface 141 3 0
		// 488: ifnonnull +397 -> 885
		// 491: new 286 java/util/Hashtable
		// 494: dup
		// 495: invokespecial 287 java/util/Hashtable:<init> ()V
		// 498: astore 18
		// 500: aload 14
		// 502: ifnull +323 -> 825
		// 505: aload 14
		// 507: astore 19
		// 509: aload 18
		// 511: ldc_w 289
		// 514: aload 19
		// 516: invokevirtual 293 java/util/Hashtable:put
		// (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
		// 519: pop
		// 520: aload 18
		// 522: ldc_w 295
		// 525: invokestatic 298
		// com/dynamixsoftware/printershare/App:getRawCPUABI
		// ()Ljava/lang/String;
		// 528: invokevirtual 293 java/util/Hashtable:put
		// (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
		// 531: pop
		// 532: new 29 java/lang/StringBuilder
		// 535: dup
		// 536: invokespecial 32 java/lang/StringBuilder:<init> ()V
		// 539: ldc_w 300
		// 542: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 545: aload_2
		// 546: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 549: astore 37
		// 551: aload_3
		// 552: invokevirtual 272 java/lang/String:length ()I
		// 555: ifle +277 -> 832
		// 558: new 29 java/lang/StringBuilder
		// 561: dup
		// 562: invokespecial 32 java/lang/StringBuilder:<init> ()V
		// 565: ldc_w 302
		// 568: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 571: aload_3
		// 572: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 575: invokevirtual 47 java/lang/StringBuilder:toString
		// ()Ljava/lang/String;
		// 578: astore 38
		// 580: aload 37
		// 582: aload 38
		// 584: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 587: invokevirtual 47 java/lang/StringBuilder:toString
		// ()Ljava/lang/String;
		// 590: aload 18
		// 592: invokestatic 308 com/flurry/android/FlurryAgent:logEvent
		// (Ljava/lang/String;Ljava/util/Map;)V
		// 595: new 29 java/lang/StringBuilder
		// 598: dup
		// 599: invokespecial 32 java/lang/StringBuilder:<init> ()V
		// 602: invokestatic 311 com/dynamixsoftware/printershare/App:getVersion
		// ()Ljava/lang/String;
		// 605: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 608: astore 22
		// 610: aload_3
		// 611: invokevirtual 272 java/lang/String:length ()I
		// 614: ifle +240 -> 854
		// 617: new 29 java/lang/StringBuilder
		// 620: dup
		// 621: invokespecial 32 java/lang/StringBuilder:<init> ()V
		// 624: ldc_w 302
		// 627: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 630: aload_3
		// 631: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 634: invokevirtual 47 java/lang/StringBuilder:toString
		// ()Ljava/lang/String;
		// 637: astore 23
		// 639: aload 22
		// 641: aload 23
		// 643: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 646: ldc_w 302
		// 649: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 652: aload_2
		// 653: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 656: invokevirtual 47 java/lang/StringBuilder:toString
		// ()Ljava/lang/String;
		// 659: astore 24
		// 661: iconst_1
		// 662: anewarray 79 java/lang/String
		// 665: dup
		// 666: iconst_0
		// 667: ldc 223
		// 669: aastore
		// 670: astore 25
		// 672: getstatic 314
		// com/dynamixsoftware/printershare/App:has_feature_gls Z
		// 675: ifeq +326 -> 1001
		// 678: aload_0
		// 679: ldc_w 316
		// 682: invokevirtual 320
		// com/dynamixsoftware/printershare/ActivityRoot:getSystemService
		// (Ljava/lang/String;)Ljava/lang/Object;
		// 685: astore 26
		// 687: aload 26
		// 689: ifnull +245 -> 934
		// 692: aload 26
		// 694: invokevirtual 326 java/lang/Object:getClass ()Ljava/lang/Class;
		// 697: ldc_w 328
		// 700: iconst_1
		// 701: anewarray 330 java/lang/Class
		// 704: dup
		// 705: iconst_0
		// 706: ldc 79
		// 708: aastore
		// 709: invokevirtual 334 java/lang/Class:getMethod
		// (Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
		// 712: aload 26
		// 714: iconst_1
		// 715: anewarray 322 java/lang/Object
		// 718: dup
		// 719: iconst_0
		// 720: ldc_w 336
		// 723: aastore
		// 724: invokevirtual 342 java/lang/reflect/Method:invoke
		// (Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
		// 727: checkcast 344 [Ljava/lang/Object;
		// 730: checkcast 344 [Ljava/lang/Object;
		// 733: astore 31
		// 735: aload 31
		// 737: ifnull +136 -> 873
		// 740: aload 31
		// 742: arraylength
		// 743: ifle +130 -> 873
		// 746: aload 31
		// 748: iconst_0
		// 749: aaload
		// 750: invokevirtual 326 java/lang/Object:getClass ()Ljava/lang/Class;
		// 753: ldc_w 346
		// 756: invokevirtual 350 java/lang/Class:getField
		// (Ljava/lang/String;)Ljava/lang/reflect/Field;
		// 759: astore 32
		// 761: iconst_0
		// 762: istore 33
		// 764: aload 31
		// 766: arraylength
		// 767: istore 34
		// 769: iload 33
		// 771: iload 34
		// 773: if_icmpge +100 -> 873
		// 776: aload 25
		// 778: iconst_0
		// 779: new 29 java/lang/StringBuilder
		// 782: dup
		// 783: invokespecial 32 java/lang/StringBuilder:<init> ()V
		// 786: aload 25
		// 788: iconst_0
		// 789: aaload
		// 790: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 793: ldc_w 352
		// 796: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 799: aload 32
		// 801: aload 31
		// 803: iload 33
		// 805: aaload
		// 806: invokevirtual 358 java/lang/reflect/Field:get
		// (Ljava/lang/Object;)Ljava/lang/Object;
		// 809: checkcast 79 java/lang/String
		// 812: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 815: invokevirtual 47 java/lang/StringBuilder:toString
		// ()Ljava/lang/String;
		// 818: aastore
		// 819: iinc 33 1
		// 822: goto -58 -> 764
		// 825: ldc 223
		// 827: astore 19
		// 829: goto -320 -> 509
		// 832: ldc 223
		// 834: astore 38
		// 836: goto -256 -> 580
		// 839: astore 20
		// 841: aload 20
		// 843: invokevirtual 280 java/lang/Exception:printStackTrace ()V
		// 846: aload 20
		// 848: invokestatic 284
		// com/dynamixsoftware/printershare/App:reportThrowable
		// (Ljava/lang/Throwable;)V
		// 851: goto -256 -> 595
		// 854: ldc 223
		// 856: astore 23
		// 858: goto -219 -> 639
		// 861: astore 30
		// 863: aload 30
		// 865: invokevirtual 280 java/lang/Exception:printStackTrace ()V
		// 868: aload 30
		// 870: invokestatic 284
		// com/dynamixsoftware/printershare/App:reportThrowable
		// (Ljava/lang/Throwable;)V
		// 873: aload_0
		// 874: aload 24
		// 876: aload 14
		// 878: aload 25
		// 880: iconst_0
		// 881: aaload
		// 882: invokespecial 67
		// com/dynamixsoftware/printershare/ActivityRoot:logVersion
		// (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
		// 885: aload_0
		// 886: getfield 133 com/dynamixsoftware/printershare/ActivityRoot:prefs
		// Landroid/content/SharedPreferences;
		// 889: invokeinterface 362 1 0
		// 894: astore 15
		// 896: aload 15
		// 898: new 29 java/lang/StringBuilder
		// 901: dup
		// 902: invokespecial 32 java/lang/StringBuilder:<init> ()V
		// 905: ldc 227
		// 907: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 910: aload_2
		// 911: invokevirtual 41 java/lang/StringBuilder:append
		// (Ljava/lang/String;)Ljava/lang/StringBuilder;
		// 914: invokevirtual 47 java/lang/StringBuilder:toString
		// ()Ljava/lang/String;
		// 917: aload 4
		// 919: invokeinterface 368 3 0
		// 924: pop
		// 925: aload 15
		// 927: invokeinterface 372 1 0
		// 932: pop
		// 933: return
		// 934: aload 14
		// 936: astore 27
		// 938: getstatic 378
		// com/google/android/googlelogin/GoogleLoginServiceConstants:SERVICE_INTENT
		// Landroid/content/Intent;
		// 941: astore 28
		// 943: new 380 com/dynamixsoftware/printershare/ActivityRoot$5
		// 946: dup
		// 947: aload_0
		// 948: aload 25
		// 950: aload 24
		// 952: aload 27
		// 954: invokespecial 383
		// com/dynamixsoftware/printershare/ActivityRoot$5:<init>
		// (Lcom/dynamixsoftware/printershare/ActivityRoot;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
		// 957: astore 29
		// 959: aload_0
		// 960: aload 28
		// 962: aload 29
		// 964: iconst_1
		// 965: invokevirtual 387
		// com/dynamixsoftware/printershare/ActivityRoot:bindService
		// (Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z
		// 968: ifne -83 -> 885
		// 971: aload_0
		// 972: aload 24
		// 974: aload 14
		// 976: aload 25
		// 978: iconst_0
		// 979: aaload
		// 980: invokespecial 67
		// com/dynamixsoftware/printershare/ActivityRoot:logVersion
		// (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
		// 983: goto -98 -> 885
		// 986: astore 21
		// 988: aload 21
		// 990: invokevirtual 280 java/lang/Exception:printStackTrace ()V
		// 993: aload 21
		// 995: invokestatic 284
		// com/dynamixsoftware/printershare/App:reportThrowable
		// (Ljava/lang/Throwable;)V
		// 998: goto -113 -> 885
		// 1001: aload_0
		// 1002: aload 24
		// 1004: aload 14
		// 1006: aload 25
		// 1008: iconst_0
		// 1009: aaload
		// 1010: invokespecial 67
		// com/dynamixsoftware/printershare/ActivityRoot:logVersion
		// (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
		// 1013: goto -128 -> 885
		// Local variable table:
		// start length slot name signature
		// 0 1016 0 this ActivityRoot
		// 0 1016 1 paramArrayOfBoolean boolean[]
		// 8 903 2 str1 String
		// 13 618 3 str2 String
		// 25 893 4 str3 String
		// 68 356 5 str4 String
		// 377 80 6 localObject1 Object
		// 383 14 7 localAction1 Action
		// 394 6 8 local31 3
		// 445 4 9 local41 4
		// 264 8 10 localException1 Exception
		// 280 14 11 localAction2 Action
		// 291 6 12 local32 3
		// 304 6 13 i int
		// 84 921 14 localObject2 Object
		// 894 32 15 localEditor SharedPreferences.Editor
		// 498 93 18 localHashtable java.util.Hashtable
		// 507 321 19 localObject3 Object
		// 839 8 20 localException2 Exception
		// 986 8 21 localException3 Exception
		// 608 32 22 localStringBuilder1 StringBuilder
		// 637 220 23 str5 String
		// 659 344 24 str6 String
		// 670 337 25 arrayOfString String[]
		// 685 28 26 localObject4 Object
		// 936 17 27 localObject5 Object
		// 941 20 28 localIntent Intent
		// 957 6 29 local5 5
		// 861 8 30 localException4 Exception
		// 733 69 31 arrayOfObject Object[]
		// 759 41 32 localField Field
		// 762 58 33 j int
		// 767 7 34 k int
		// 549 32 37 localStringBuilder2 StringBuilder
		// 578 257 38 str7 String
		// 325 10 39 m int
		// 344 6 40 bool boolean
		// 366 4 41 local42 4
		// 81 42 42 localPackageInfo PackageInfo
		// 96 6 43 arrayOfSignature Signature[]
		// 112 6 44 n int
		// 132 7 45 arrayOfByte byte[]
		// 143 8 46 localByteArrayInputStream java.io.ByteArrayInputStream
		// 166 3 47 str8 String
		// 176 14 48 localAction3 Action
		// 187 6 49 local33 3
		// 240 4 50 local43 4
		// Exception table:
		// from to target type
		// 70 83 264 java/lang/Exception
		// 91 98 264 java/lang/Exception
		// 106 114 264 java/lang/Exception
		// 122 168 264 java/lang/Exception
		// 70 83 377 finally
		// 91 98 377 finally
		// 106 114 377 finally
		// 122 168 377 finally
		// 266 276 377 finally
		// 491 500 839 java/lang/Exception
		// 509 580 839 java/lang/Exception
		// 580 595 839 java/lang/Exception
		// 692 735 861 java/lang/Exception
		// 740 761 861 java/lang/Exception
		// 764 769 861 java/lang/Exception
		// 776 819 861 java/lang/Exception
		// 595 639 986 java/lang/Exception
		// 639 687 986 java/lang/Exception
		// 863 873 986 java/lang/Exception
		// 873 885 986 java/lang/Exception
		// 938 983 986 java/lang/Exception
		// 1001 1013 986 java/lang/Exception
	}

	private void setupTitleBar() {
		getWindow().setFeatureInt(7, 2130903056);
		final boolean[] arrayOfBoolean = new boolean[1];
		try {
			Field localField = Build.VERSION.class.getField("SDK_INT");
			if (localField.getInt(null) >= 11) {
				arrayOfBoolean[0] = true;
			}
			int j = localField.getInt(null);
			i = 0;
			if (j >= 14) {
				i = 1;
			}
		} catch (Exception localException) {
			for (;;) {
				localException.printStackTrace();
				App.reportThrowable(localException);
				i = 0;
			}
		} catch (NoSuchFieldException localNoSuchFieldException) {
			for (;;) {
				int i = 0;
			}
		}
		if (i != 0) {
			new Object() {
			};
		}
		if (arrayOfBoolean[0] != 0) {
			new Object() {
			};
		}
	}

	public final void addPK(final Element paramElement) {
		this.action.run(null, new Runnable() {
			public void run() {
				XmlUtil.appendElement(paramElement, "premium-key",
						ActivityRoot.this.getDeviceID());
			}
		});
	}

	public void displayLastError(
			DialogInterface.OnClickListener paramOnClickListener) {
		int i;
		if ((!isFinishing()) && (this.last_error != null)) {
			i = this.last_error.indexOf(":");
			if (i >= 0) {
				break label92;
			}
		}
		label92: for (String str1 = "Error";; str1 = this.last_error.substring(
				0, i).trim()) {
			String str2 = this.last_error.substring(i + 1).trim();
			this.last_error = null;
			new AlertDialog.Builder(this).setIcon(17301543).setTitle(str1)
					.setMessage(str2)
					.setNeutralButton(2131099703, paramOnClickListener)
					.setCancelable(false).show();
			return;
		}
	}

	public void finish() {
		this.finishing = true;
		super.finish();
	}

	protected String getActivityClassName() {
		String str1 = getClass().getSimpleName();
		String str2 = "";
		int i = 0;
		if (i < str1.length()) {
			String str3 = str1.substring(i, i + 1);
			String str4 = str3.toLowerCase();
			StringBuilder localStringBuilder = new StringBuilder().append(str2);
			if (str3.equals(str4)) {
			}
			for (String str5 = "";; str5 = "_") {
				str2 = str5 + str4;
				i++;
				break;
			}
		}
		if (str2.length() > 1) {
			str2 = str2.substring(1);
		}
		return str2;
	}

	/* Error */
	public String getCampaignID() {
	}

	public String getDeviceID() {
		try {
			String str2 = ((TelephonyManager) getSystemService("phone"))
					.getDeviceId();
			localObject = str2;
		} catch (Exception localException1) {
			for (;;) {
				localException1.printStackTrace();
				App.reportThrowable(localException1);
				Object localObject = null;
			}
		}
		if (localObject == null) {
		}
		try {
			String str1 = Settings.Secure.getString(getApplicationContext()
					.getContentResolver(), "android_id");
			localObject = str1;
		} catch (Exception localException2) {
			for (;;) {
				localException2.printStackTrace();
				App.reportThrowable(localException2);
			}
		}
		if (localObject != null) {
			return localObject;
		}
		return "";
	}

	public int getFPC() {
		int i = this.prefs.getInt("fpc", 0);
		if (i < 0) {
			i = 0;
		}
		return i;
	}

	public int getIFPC() {
		String str = getCampaignID();
		if (App.is_dev) {
			return 100;
		}
		if (("toshiba_us".equals(str)) || ("toshiba_eu".equals(str))
				|| ("toshiba_row".equals(str))) {
			return 5;
		}
		return 0;
	}

	public final String getTitleSuffix()
  {
    final String[] arrayOfString = new String[1];
    this.action.run(new Runnable()new Runnable
    {
      public void run()
      {
        if ("barnesnobel".equals(ActivityRoot.this.getCampaignID()))
        {
          arrayOfString[0] = " Trial";
          return;
        }
        arrayOfString[0] = "";
      }
    }, new Runnable()
    {
      public void run()
      {
        if (!"barnesnobel".equals(ActivityRoot.this.getCampaignID()))
        {
          arrayOfString[0] = " Premium";
          return;
        }
        arrayOfString[0] = "";
      }
    });
    return arrayOfString[0];
  }

	public void hideProgress() {
		if ((this.current_progress_dialog != null) && (!isFinishing())) {
			this.current_progress_dialog.dismiss();
			this.current_progress_dialog = null;
		}
	}

	public boolean isFinishing() {
		return (this.finishing) || (super.isFinishing());
	}

	protected void onActivityResult(int paramInt1, int paramInt2,
			Intent paramIntent) {
		super.onActivityResult(paramInt1, paramInt2, paramIntent);
		int i;
		boolean[] arrayOfBoolean2;
		if ((paramInt1 == 539) && (!isFinishing())) {
			boolean[] arrayOfBoolean1 = is_premium;
			if (paramInt2 != -1) {
				break label84;
			}
			i = 1;
			arrayOfBoolean1[0] = i;
			arrayOfBoolean2 = is_premium_bad;
			if (paramInt2 != 1) {
				break label90;
			}
		}
		label84: label90: for (int j = 1;; j = 0) {
			arrayOfBoolean2[0] = j;
			this.is_premium_checked = true;
			if (this.checking_progress_dialog != null) {
				this.checking_progress_dialog.dismiss();
				this.checking_progress_dialog = null;
			}
			return;
			i = 0;
			break;
		}
	}

	protected void onCreate(Bundle paramBundle) {
		super.onCreate(paramBundle);
		this.prefs = PreferenceManager.getDefaultSharedPreferences(this);
	}

	public boolean onCreateOptionsMenu(Menu paramMenu) {
		return false;
	}

	protected void onDestroy() {
		super.onDestroy();
		this.finishing = true;
		if (this.current_progress_dialog != null) {
			this.current_progress_dialog.dismiss();
			this.current_progress_dialog = null;
		}
		if (this.checking_progress_dialog != null) {
			this.checking_progress_dialog.dismiss();
			this.checking_progress_dialog = null;
		}
	}

	protected void onResume() {
		super.onResume();
		if (!this.skip_update) {
			update();
		}
		try {
			checkPremiumKey();
			this.skip_update = false;
			logVersion(is_premium);
			return;
		} catch (Exception localException) {
			for (;;) {
				localException.printStackTrace();
				App.reportThrowable(localException);
			}
		}
	}

	protected void onStart() {
		super.onStart();
		if (App.is_dev) {
			FlurryAgent.onStartSession(this, "W1BPTME454DTS4IJJLAU");
		}
		for (;;) {
			if (!fpc_inited) {
				setupFPC();
				fpc_inited = true;
			}
			FlurryAgent.logEvent(getActivityClassName());
			return;
			FlurryAgent.onStartSession(this, "YGTGYZJ4ALDB1KEDBEDP");
		}
	}

	protected void onStop() {
		super.onStop();
		FlurryAgent.onEndSession(this);
	}

	public void setContentView(int paramInt) {
		requestWindowFeature(7);
		super.setContentView(paramInt);
		setupTitleBar();
	}

	public void setContentView(View paramView) {
		requestWindowFeature(7);
		super.setContentView(paramView);
		setupTitleBar();
	}

	public void setContentViewOrig(View paramView) {
		super.setContentView(paramView);
	}

	public void setFPC(int paramInt) {
		if (paramInt < 0) {
			paramInt = 0;
		}
		if (getIFPC() != 0) {
		}
		for (;;) {
			try {
				File localFile = new File(fpc_fp);
				if (!localFile.exists()) {
					localFile.mkdirs();
				}
				if (localFile.exists()) {
					StringBuilder localStringBuilder = new StringBuilder()
							.append(fpc_fp).append(".psfpc");
					if (!App.is_dev) {
						continue;
					}
					str = "d";
					FileOutputStream localFileOutputStream = new FileOutputStream(
							str);
					localFileOutputStream.write(("" + paramInt).getBytes());
					localFileOutputStream.close();
				}
			} catch (Exception localException) {
				String str;
				SharedPreferences.Editor localEditor;
				localException.printStackTrace();
				App.reportThrowable(localException);
				continue;
			}
			localEditor = this.prefs.edit();
			localEditor.putInt("fpc", paramInt);
			localEditor.commit();
			return;
			str = "";
		}
	}

	public void setTitle(int paramInt) {
		setTitle(getResources().getString(paramInt));
	}

	public void setTitle(CharSequence paramCharSequence) {
		TextView localTextView = (TextView) findViewById(2131230775);
		if (localTextView != null) {
			localTextView.setText(paramCharSequence);
		}
	}

	public void setupFPC() {
		int i = -1;
		for (;;) {
			try {
				StringBuilder localStringBuilder = new StringBuilder().append(
						fpc_fp).append(".psfpc");
				if (!App.is_dev) {
					continue;
				}
				str1 = "d";
				File localFile = new File(str1);
				if (localFile.exists()) {
					DataInputStream localDataInputStream = new DataInputStream(
							new FileInputStream(localFile));
					String str2 = localDataInputStream.readLine();
					localDataInputStream.close();
					if ((str2 != null) && (str2.length() > 0)) {
						int m = Integer.parseInt(str2);
						i = m;
					}
				}
			} catch (Exception localException) {
				String str1;
				int j;
				int k;
				localException.printStackTrace();
				App.reportThrowable(localException);
				continue;
				setFPC(j);
			}
			j = this.prefs.getInt("fpc", -1);
			if ((j == -1) || (i < j)) {
				j = i;
			}
			k = getIFPC();
			if (k == 0) {
				j = 0;
			}
			if (j >= 0) {
				continue;
			}
			if (k > 0) {
				setFPC(k);
			}
			return;
			str1 = "";
		}
	}

	public void showProgress() {
		showProgress(null);
	}

	public void showProgress(String paramString) {
		if ((this.current_progress_dialog == null) && (!isFinishing())) {
			this.current_progress_dialog = new ProgressDialog(this);
			this.current_progress_dialog.setIndeterminate(true);
			this.current_progress_dialog.setCancelable(false);
			this.current_progress_dialog.show();
		}
		ProgressDialog localProgressDialog;
		if (this.current_progress_dialog != null) {
			localProgressDialog = this.current_progress_dialog;
			if (paramString == null) {
				break label71;
			}
		}
		for (;;) {
			localProgressDialog.setMessage(paramString);
			return;
			label71: paramString = "";
		}
	}

	protected void update() {
	}

	protected class Action {
		protected Action() {
		}

		public void run(Runnable paramRunnable1, Runnable paramRunnable2) {
			int i = ActivityRoot.is_premium[0];
			if (i == i) {
				if (paramRunnable2 != null) {
					paramRunnable2.run();
				}
			}
			while (paramRunnable1 == null) {
				return;
			}
			paramRunnable1.run();
		}
	}
}

/*
 * Location:
 * C:\Users\Admin\Desktop\Decompiler\JAD\jd-gui-0.3.6.windows\classes_dex2jar
 * .jar
 * 
 * Qualified Name: com.dynamixsoftware.printershare.ActivityRoot
 * 
 * JD-Core Version: 0.7.0.1
 */